package zhihui.mobile.manager.phone;

import com.zgm.utils.ReflexObjectUtil;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import zhihui.mobile.bean.phone.CodeParams;
import zhihui.mobile.config.Config;
import zhihui.mobile.interfaces.net.IHttpCallBackListener;
import zhihui.mobile.manager.IManager;
import zhihui.mobile.net.HttpUtils;

/**
 * Created by 张公铭 on 2017/7/11 0011.
 */

public class PhoneManager implements IManager
{
    private static PhoneManager manager;

    private synchronized static void createdIns()
    {
        if (manager == null)
        {
            manager = new PhoneManager();
        }
    }

    public static PhoneManager getIntance()
    {
        if (manager == null)
        {
            createdIns();
        }
        return manager;
    }

    public void sendMessage(CodeParams codeParams, IHttpCallBackListener listener)
    {
        Map<String, String> params = new HashMap<>();
        params.put("service", "user");
        params.put("method", "getMessage");

        List<Object> values = new ArrayList<>();
        values.add(codeParams.getPhone());
        values.add(codeParams.getType());
        HttpUtils.postAes(Config.URL, params, values, listener);
    }

    @Override
    public void clear()
    {

    }
}
